﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using MS.InformationManagement.Support.Constants;
using MS.InformationManagement.DAL.DocumentCenter;
using MS.InformationManagement.Support;
using System.IO;
using System.Globalization;
using System.Collections;

namespace MS.InformationManagement.BLL.RadicadosAnulados
{
    public class RadicadosAnulados
    {
        public static List<Radicado> getRadicadosAnulados(int pageIndex, int pageSize, out int totalRecords)
        {
            List<Radicado> foundAnulados = new List<Radicado>();
            int startingPosition = pageIndex * pageSize;
            using (var dc = new DCDocumentCenterDataContext(SPContext.Current.Web.Url))
            {
                foundAnulados = (from rdc in dc.GetList<Radicado>(GlobalConstants.LIST_ANULADOS)
                                 select rdc).ToList();
            }
            if (foundAnulados == null)
            {
                totalRecords = 0;
                return null;
            }

            totalRecords = foundAnulados.Count();
            return foundAnulados.Skip(startingPosition).Take(pageSize).ToList();
        }

    }
}
